home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / d.dxr / 00007_MIXXER CODE.ls next >
Encoding:
Text File  |  1996-02-15  |  20.9 KB  |  563 lines

  1. global gRecordingIsAHit, gPlugInMixer, gPatchPlugUpInMixer, gPatchPlugDownInMixer, gPlugDestinations, sQTCharSprite, gCDName, gFileSep, gObjects, gPaletteRects, gOBJECTSD, gMixerDJAifList, gNotesPointer, gNotes, gInstrumentInCDTrack, gCDNotes, Recordtimes
  2.  
  3. on resetLocCable OBJref
  4.   set OBj to getaProp(gObjects, OBJref)
  5.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #left)
  6.   setaProp(OBj, #DisplayState, #left)
  7.   set the rect of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #Orginalrect)
  8. end
  9.  
  10. on resetLocPlug OBJref
  11.   set OBj to getaProp(gObjects, OBJref)
  12.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #UN)
  13.   set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #OrginalLOC)
  14.   setaProp(OBj, #DisplayState, #UN)
  15.   set hole to getaProp(OBj, #HoleNum)
  16.   if not voidp(hole) or (hole <> #void) then
  17.     UNPluginHole(OBJref)
  18.   end if
  19. end
  20.  
  21. on resetIntPlug OBJref
  22.   set OBj to getaProp(gObjects, OBJref)
  23.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #UN)
  24.   set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #OrginalLOC)
  25.   setaProp(OBj, #DisplayState, #UN)
  26. end
  27.  
  28. on PLUGinHoleIntrument OBJref
  29.   set OBj to getaProp(gObjects, OBJref)
  30.   set cableref to getaProp(getaProp(OBj, #CABLE), #RefName)
  31.   set hole to getaProp(OBj, #HoleNum)
  32.   if voidp(hole) or (hole = #void) then
  33.     resetIntPlug(OBJref)
  34.     resetLocCable(cableref)
  35.     updateStage()
  36.   else
  37.     set Mobj to getaProp(gObjects, getAt(getaProp(getaProp(gObjects, #MIXER), #MusicBars), getaProp(OBj, #HoleNum)))
  38.     set IOBJ to getaProp(gObjects, getAt(getaProp(getaProp(gObjects, #MIXER), #IntBars), getaProp(OBj, #HoleNum)))
  39.     set Monitor to getaProp(gObjects, getaProp(getaProp(getaProp(gObjects, #MIXER), #monitors), getaProp(OBj, #INTRument)))
  40.     set the castNum of sprite getaProp(Mobj, #SpriteNum) to getaProp(getaProp(Mobj, #cast), getaProp(Monitor, #DisplayState))
  41.     set the castNum of sprite getaProp(IOBJ, #SpriteNum) to getaProp(getaProp(IOBJ, #cast), getaProp(OBj, #INTRument))
  42.   end if
  43.   set ObjrefList to [OBJref, cableref]
  44.   repeat with ref in ObjrefList
  45.     DynamicLOCRECT(ref)
  46.   end repeat
  47. end
  48.  
  49. on IntruDetails
  50.   repeat with X = 1 to 4
  51.     set INTRU to getAt(getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #INSin), #Filled), X)
  52.     if INTRU <> 0 then
  53.       set OBj to getaProp(gObjects, INTRU)
  54.       set Mobj to getaProp(gObjects, getAt(getaProp(getaProp(gObjects, #MIXER), #MusicBars), X))
  55.       set IOBJ to getaProp(gObjects, getAt(getaProp(getaProp(gObjects, #MIXER), #IntBars), X))
  56.       set Monitor to getaProp(gObjects, getaProp(getaProp(getaProp(gObjects, #MIXER), #monitors), getaProp(OBj, #INTRument)))
  57.       set the castNum of sprite getaProp(Mobj, #SpriteNum) to getaProp(getaProp(Mobj, #cast), getaProp(Monitor, #DisplayState))
  58.       set the castNum of sprite getaProp(IOBJ, #SpriteNum) to getaProp(getaProp(IOBJ, #cast), getaProp(OBj, #INTRument))
  59.     end if
  60.   end repeat
  61. end
  62.  
  63. on PluginHoleMixin OBJref
  64.   set OBj to getaProp(gObjects, OBJref)
  65.   set Parentref to getaProp(OBj, #Parent)
  66.   set cableref to getaProp(getaProp(OBj, #CABLE), #RefName)
  67.   set hole to getaProp(OBj, #HoleNum)
  68.   if voidp(hole) or (hole = #void) then
  69.     resetLocPlug(OBJref)
  70.     resetLocPlug(Parentref)
  71.     resetLocCable(cableref)
  72.     updateStage()
  73.   else
  74.   end if
  75.   set ObjrefList to [OBJref, cableref, Parentref]
  76.   repeat with ref in ObjrefList
  77.     DynamicLOCRECT(ref)
  78.   end repeat
  79. end
  80.  
  81. on PluginHoleMixout OBJref
  82.   set OBj to getaProp(gObjects, OBJref)
  83.   set Childplugref to getaProp(OBj, #ChildPlug)
  84.   set cableref to getaProp(getaProp(OBj, #CABLE), #RefName)
  85.   set hole to getaProp(OBj, #HoleNum)
  86.   if voidp(hole) or (hole = #void) then
  87.     resetLocPlug(OBJref)
  88.     resetLocPlug(Childplugref)
  89.     resetLocCable(cableref)
  90.     updateStage()
  91.   else
  92.   end if
  93.   set ObjrefList to [OBJref, cableref, Childplugref]
  94.   repeat with ref in ObjrefList
  95.     DynamicLOCRECT(ref)
  96.   end repeat
  97. end
  98.  
  99. on GrabPlugIntro OBJref
  100.   set H to the mouseH
  101.   set V to the mouseV
  102.   set OBj to getaProp(gObjects, OBJref)
  103.   set INTR to getaProp(gObjects, getaProp(OBj, #INTRument))
  104.   set cableref to getaProp(getaProp(OBj, #CABLE), #RefName)
  105.   set Anchor to getaProp(getaProp(gObjects, cableref), #Anchor)
  106.   cursor(getaProp(gCursorlist, #Grab))
  107.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #UN)
  108.   set arect to rect(the locH of sprite getaProp(OBj, #SpriteNum), the locV of sprite getaProp(OBj, #SpriteNum), the locH of Anchor, the locV of Anchor)
  109.   CableUpdate(cableref, arect)
  110.   updateStage()
  111.   MakeDynamic(cableref, #DisplayState, getaProp(getaProp(gObjects, cableref), #DisplayState))
  112.   set hole to getaProp(OBj, #HoleNum)
  113.   if not voidp(hole) and (hole <> #void) then
  114.     set Mobj to getaProp(gObjects, getAt(getaProp(getaProp(gObjects, #MIXER), #MusicBars), getaProp(OBj, #HoleNum)))
  115.     set IOBJ to getaProp(gObjects, getAt(getaProp(getaProp(gObjects, #MIXER), #IntBars), getaProp(OBj, #HoleNum)))
  116.     set the castNum of sprite getaProp(Mobj, #SpriteNum) to getaProp(getaProp(Mobj, #cast), #UN)
  117.     set the castNum of sprite getaProp(IOBJ, #SpriteNum) to getaProp(getaProp(IOBJ, #cast), #UN)
  118.   end if
  119.   UNPluginHole(OBJref)
  120.   PLugDRAGCable(OBJref, getaProp(getaProp(OBj, #CABLE), #RefName), Anchor, H, V)
  121.   if PluginHole(OBJref) = #true then
  122.     MakeDynamic(getaProp(INTR, #RefName), #PlugInMixer, #true)
  123.   else
  124.     MakeDynamic(getaProp(INTR, #RefName), #PlugInMixer, #false)
  125.   end if
  126.   if not voidp(getaProp(getaProp(OBj, #Action), #UP)) then
  127.     do(getaProp(getaProp(OBj, #Action), #UP))
  128.   end if
  129. end
  130.  
  131. on GrabPlugMixin OBJref
  132.   set H to the mouseH
  133.   set V to the mouseV
  134.   set OBj to getaProp(gObjects, OBJref)
  135.   set cableref to getaProp(getaProp(OBj, #CABLE), #RefName)
  136.   set Anchor to the loc of sprite getaProp(getaProp(gObjects, getaProp(OBj, #Parent)), #SpriteNum)
  137.   cursor(getaProp(gCursorlist, #Grab))
  138.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #UN)
  139.   set arect to rect(the locH of sprite getaProp(OBj, #SpriteNum), the locV of sprite getaProp(OBj, #SpriteNum), the locH of Anchor, the locV of Anchor)
  140.   CableUpdate(cableref, arect)
  141.   updateStage()
  142.   MakeDynamic(cableref, #DisplayState, getaProp(getaProp(gObjects, cableref), #DisplayState))
  143.   UNPluginHole(OBJref)
  144.   PLugDRAGCable(OBJref, cableref, Anchor, H, V)
  145.   if PluginHole(OBJref) = #true then
  146.   end if
  147.   if not voidp(getaProp(getaProp(OBj, #Action), #UP)) then
  148.     do(getaProp(getaProp(OBj, #Action), #UP))
  149.   end if
  150. end
  151.  
  152. on GrabPlugMixout OBJref
  153.   set H to the mouseH
  154.   set V to the mouseV
  155.   set OBj to getaProp(gObjects, OBJref)
  156.   set cableref to getaProp(getaProp(OBj, #CABLE), #RefName)
  157.   set Anchor to the loc of sprite getaProp(getaProp(gObjects, getaProp(OBj, #ChildPlug)), #SpriteNum)
  158.   cursor(getaProp(gCursorlist, #Grab))
  159.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #UN)
  160.   set arect to rect(the locH of sprite getaProp(OBj, #SpriteNum), the locV of sprite getaProp(OBj, #SpriteNum), the locH of Anchor, the locV of Anchor)
  161.   CableUpdate(cableref, arect)
  162.   updateStage()
  163.   MakeDynamic(cableref, #DisplayState, getaProp(getaProp(gObjects, cableref), #DisplayState))
  164.   UNPluginHole(OBJref)
  165.   PLugDRAGCable(OBJref, cableref, Anchor, H, V)
  166.   if PluginHole(OBJref) = #true then
  167.   end if
  168.   if not voidp(getaProp(getaProp(OBj, #Action), #UP)) then
  169.     do(getaProp(getaProp(OBj, #Action), #UP))
  170.   end if
  171. end
  172.  
  173. on CheckIntruPatch
  174.   set INTRU to getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #INSin), #Filled)
  175.   if getOne(INTRU, 0) = 0 then
  176.     MakeDynamic(#MIXER, #IntruPatched, #true)
  177.     return #true
  178.   else
  179.     MakeDynamic(#MIXER, #IntruPatched, #false)
  180.     return #false
  181.   end if
  182. end
  183.  
  184. on CheckPlayRecord
  185.   set INs to getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #Mixin), #Filled)
  186.   set Outs to getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #MixOut), #Filled)
  187.   set INTRU to getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #INSin), #Filled)
  188.   set Patchlist to []
  189.   repeat with NUM = 1 to 4
  190.     if getAt(Outs, NUM) <> 0 then
  191.       if getOne(INs, getaProp(getaProp(gObjects, getAt(Outs, NUM)), #ChildPlug)) <> 0 then
  192.         if getAt(INTRU, NUM) <> 0 then
  193.           if getaProp(gNotes, getaProp(getaProp(gObjects, getAt(INTRU, NUM)), #INTRument)) <> [] then
  194.             add(Patchlist, getaProp(getaProp(gObjects, getAt(INTRU, NUM)), #INTRument))
  195.           end if
  196.         end if
  197.       end if
  198.     end if
  199.   end repeat
  200.   if Patchlist <> [] then
  201.     return Patchlist
  202.   else
  203.     return #false
  204.     if voidp(Recordtimes) then
  205.       set Recordtimes to 1
  206.     else
  207.       PDARelease("J04m13p.mov")
  208.     end if
  209.   end if
  210. end
  211.  
  212. on CheckPlayClearChannel OBJref
  213.   set OBj to getaProp(gObjects, OBJref)
  214.   set NUM to getaProp(OBj, #NUM)
  215.   set INs to getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #Mixin), #Filled)
  216.   set Outs to getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #MixOut), #Filled)
  217.   set INTRU to getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #INSin), #Filled)
  218.   set INTRument to #false
  219.   if getAt(Outs, NUM) <> 0 then
  220.     set ChildPlug to getaProp(getaProp(gObjects, getAt(Outs, NUM)), #ChildPlug)
  221.     if getOne(INs, ChildPlug) <> 0 then
  222.       if getAt(INTRU, NUM) <> 0 then
  223.         set INTRument to getaProp(getaProp(gObjects, getAt(INTRU, NUM)), #INTRument)
  224.       end if
  225.     end if
  226.   end if
  227.   return INTRument
  228. end
  229.  
  230. on CheckClearMixChannel OBJref
  231.   set OBj to getaProp(gObjects, OBJref)
  232.   set NUM to getaProp(OBj, #NUM)
  233.   set INs to getAt(getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #Mixin), #Filled), NUM)
  234.   set Outs to getAt(getaProp(getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), #MixOut), #Filled), NUM)
  235.   if (getOne(INs, 0) = 0) and (getOne(Outs, 0) = 0) then
  236.     return #true
  237.   else
  238.     return #false
  239.   end if
  240. end
  241.  
  242. on PluginHole OBJref
  243.   set OBj to getaProp(gObjects, OBJref)
  244.   set HoleFilled to CheckOpenHole(OBJref)
  245.   if HoleFilled = #false then
  246.     return #false
  247.   end if
  248.   set PlugType to getaProp(OBj, #PlugType)
  249.   set HOLES to getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), PlugType)
  250.   set Filled to getaProp(HOLES, #Filled)
  251.   playSound(getaProp(getaProp(OBj, #sound), #Plug), #cast)
  252.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #Pluged)
  253.   set the loc of sprite getaProp(OBj, #SpriteNum) to getAt(getaProp(HOLES, #loc), HoleFilled)
  254.   updateStage()
  255.   setaProp(OBj, #DisplayState, #Pluged)
  256.   setAt(Filled, HoleFilled, OBJref)
  257.   setaProp(OBj, #HoleNum, HoleFilled)
  258.   MakeDynamic(OBJref, #DisplayState, getaProp(OBj, #DisplayState))
  259.   return #true
  260. end
  261.  
  262. on UNPluginHole OBJref
  263.   set OBj to getaProp(gObjects, OBJref)
  264.   StopPlayMixer()
  265.   set hole to getaProp(OBj, #HoleNum)
  266.   if voidp(hole) or (hole = #void) then
  267.     exit
  268.   end if
  269.   set PlugType to getaProp(OBj, #PlugType)
  270.   set HOLES to getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), PlugType)
  271.   set Filled to getaProp(HOLES, #Filled)
  272.   setAt(Filled, getaProp(OBj, #HoleNum), 0)
  273.   MakeDynamic(getaProp(OBj, #RefName), #HoleNum, #void)
  274. end
  275.  
  276. on CheckOpenHole OBJref
  277.   set OBj to getaProp(gObjects, OBJref)
  278.   set PlugType to getaProp(OBj, #PlugType)
  279.   set HOLES to getaProp(getaProp(getaProp(gObjects, #MIXER), #Patchlist), PlugType)
  280.   set Slots to getaProp(HOLES, #Slots)
  281.   set Filled to getaProp(HOLES, #Filled)
  282.   set C to count(Slots)
  283.   repeat with R = 1 to C
  284.     if inside(the loc of sprite getaProp(OBj, #SpriteNum), getAt(Slots, R)) then
  285.       if getAt(Filled, R) = 0 then
  286.         return R
  287.         next repeat
  288.       end if
  289.       return #false
  290.     end if
  291.   end repeat
  292.   return #false
  293. end
  294.  
  295. on GrabPullAll OBJref
  296.   set H to the mouseH
  297.   set V to the mouseV
  298.   set OBj to getaProp(gObjects, OBJref)
  299.   set SpriteList to [[#SpriteNum: getaProp(OBj, #SpriteNum), #OffsetH: H - the locH of sprite getaProp(OBj, #SpriteNum), #OffsetV: V - the locV of sprite getaProp(OBj, #SpriteNum)]]
  300.   set ObjrefList to [OBJref]
  301.   repeat with C in getaProp(OBj, #Children)
  302.     set O to getaProp(gObjects, C)
  303.     add(ObjrefList, C)
  304.     add(SpriteList, [#SpriteNum: getaProp(O, #SpriteNum), #OffsetH: H - the locH of sprite getaProp(O, #SpriteNum), #OffsetV: V - the locV of sprite getaProp(O, #SpriteNum)])
  305.   end repeat
  306.   set OBJcount to count(ObjrefList)
  307.   if not voidp(getaProp(getaProp(OBj, #sound), #down)) then
  308.     playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast)
  309.   end if
  310.   updateStage()
  311.   repeat while the mouseDown
  312.     repeat with Snum in SpriteList
  313.       set the locV of sprite getaProp(Snum, #SpriteNum) to V - getaProp(Snum, #OffsetV)
  314.       set the locH of sprite getaProp(Snum, #SpriteNum) to H - getaProp(Snum, #OffsetH)
  315.     end repeat
  316.     CursorandUpdate()
  317.     set H to the mouseH
  318.     set V to the mouseV
  319.   end repeat
  320.   if not voidp(getaProp(getaProp(OBj, #sound), #UP)) then
  321.     playSound(getaProp(getaProp(OBj, #sound), #UP), #keyframeCast)
  322.   end if
  323.   updateStage()
  324.   cursor(getaProp(gCursorlist, #Hand))
  325.   updateStage()
  326. end
  327.  
  328. on PLugDRAGCable OBJref, cableref, Anchor, H, V
  329.   set OBj to getaProp(gObjects, OBJref)
  330.   set CABLE to getaProp(gObjects, cableref)
  331.   set OffsetH to H - the locH of sprite getaProp(OBj, #SpriteNum)
  332.   set OffsetV to V - the locV of sprite getaProp(OBj, #SpriteNum)
  333.   if not voidp(getaProp(getaProp(OBj, #sound), #down)) then
  334.     playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast)
  335.   end if
  336.   repeat while the mouseDown
  337.     set the locV of sprite getaProp(OBj, #SpriteNum) to V - OffsetV
  338.     set the locH of sprite getaProp(OBj, #SpriteNum) to H - OffsetH
  339.     set arect to rect(the locH of sprite getaProp(OBj, #SpriteNum), the locV of sprite getaProp(OBj, #SpriteNum), the locH of Anchor, the locV of Anchor)
  340.     CableUpdate(cableref, arect)
  341.     CursorandUpdate()
  342.     set H to the mouseH
  343.     set V to the mouseV
  344.   end repeat
  345.   MakeDynamic(cableref, #DisplayState, getaProp(getaProp(gObjects, cableref), #DisplayState))
  346.   cursor(getaProp(gCursorlist, #Hand))
  347.   if not voidp(getaProp(getaProp(OBj, #sound), #UP)) then
  348.     playSound(getaProp(getaProp(OBj, #sound), #UP), #keyframeCast)
  349.   end if
  350. end
  351.  
  352. on DetermineLine L, T, R, B
  353.   if (L < R) and (T > B) then
  354.     return #right
  355.   else
  356.     if (L > R) and (T > B) then
  357.       return #left
  358.     else
  359.       if (L < R) and (T < B) then
  360.         return #left
  361.       else
  362.         if (L > R) and (T < B) then
  363.           return #right
  364.         end if
  365.       end if
  366.     end if
  367.   end if
  368.   return #false
  369. end
  370.  
  371. on DJFeedback Kind
  372.   if Kind = #random then
  373.     set firstBadRecord to getaProp(getaProp(gObjects, #REcordPlayMixer), #firstBadRecord)
  374.     if voidp(firstBadRecord) then
  375.       set fileName to "D07DJb1.aif"
  376.       MakeDynamic(#REcordPlayMixer, #firstBadRecord, 1)
  377.     else
  378.       set DJSound to [#ran1: "D07DJb9.aif", #ran3: "D07DJb10.aif", #ran4: "D07DJb12.aif", #ran5: "D07DJb14.aif", #ran6: "D07DJb15.aif", #ran7: "D07DJb16.aif", #ran9: "D07DJht4.aif"]
  379.       set C to count(DJSound)
  380.       set fileName to getAt(DJSound, random(C))
  381.     end if
  382.   else
  383.     if Kind = #help1 then
  384.       set fileName to "D22DJgd4.aif"
  385.     else
  386.       if Kind = #help2 then
  387.         set fileName to "D22DJgd5.aif"
  388.       end if
  389.     end if
  390.   end if
  391.   playSound(fileName, #File, 1)
  392. end
  393.  
  394. on StopPlayMixer
  395.   stopPlayAllTracks()
  396.   set the castNum of sprite getaProp(getaProp(gObjects, #REcordPlayMixer), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, #REcordPlayMixer), #cast), #UN)
  397.   set the castNum of sprite getaProp(getaProp(gObjects, #PlayClearStatus), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, #PlayClearStatus), #cast), #UN)
  398. end
  399.  
  400. on PlayClearPlay OBJref
  401.   StopPlayMixer()
  402.   set OBj to getaProp(gObjects, OBJref)
  403.   set PAR to getaProp(gObjects, getaProp(OBj, #Parent))
  404.   set NUM to getaProp(OBj, #NUM)
  405.   set the castNum of sprite getaProp(PAR, #SpriteNum) to getAt(getaProp(getaProp(PAR, #cast), #play), NUM)
  406.   updateStage()
  407.   set PlayThis to CheckPlayClearChannel(OBJref)
  408.   if PlayThis <> #false then
  409.     playOneTrack(PlayThis, "StopPlayMixer")
  410.   else
  411.   end if
  412. end
  413.  
  414. on PlayClearClear OBJref
  415.   StopPlayMixer()
  416.   set OBj to getaProp(gObjects, OBJref)
  417.   set PAR to getaProp(gObjects, getaProp(OBj, #Parent))
  418.   set NUM to getaProp(OBj, #NUM)
  419.   set the castNum of sprite getaProp(PAR, #SpriteNum) to getAt(getaProp(getaProp(PAR, #cast), #Clear), NUM)
  420.   updateStage()
  421.   set PlayThis to CheckPlayClearChannel(OBJref)
  422.   if PlayThis <> #false then
  423.     eraseRecording(PlayThis)
  424.   else
  425.   end if
  426.   set the castNum of sprite getaProp(PAR, #SpriteNum) to getaProp(getaProp(PAR, #cast), #UN)
  427.   updateStage()
  428. end
  429.  
  430. on PlayMixer OBJref
  431.   StopPlayMixer()
  432.   set OBj to getaProp(gObjects, OBJref)
  433.   set the castNum of sprite getaProp(getaProp(gObjects, #REcordPlayMixer), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, #REcordPlayMixer), #cast), #play)
  434.   updateStage()
  435.   set Playlist to CheckPlayRecord()
  436.   if Playlist <> #false then
  437.     playAllRecordedTracksOrCD(gNotes, Playlist, "StopPlayMixer")
  438.   else
  439.     set the castNum of sprite getaProp(getaProp(gObjects, #REcordPlayMixer), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, #REcordPlayMixer), #cast), #UN)
  440.   end if
  441. end
  442.  
  443. on RecordMixer OBJref
  444.   StopPlayMixer()
  445.   set the castNum of sprite getaProp(getaProp(gObjects, #REcordPlayMixer), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, #REcordPlayMixer), #cast), #Record)
  446.   updateStage()
  447.   if getaProp(getaProp(gObjects, #DJVid), #newhit) <> #enter then
  448.     exit
  449.   end if
  450.   set OBj to getaProp(gObjects, OBJref)
  451.   set NOTgood to #false
  452.   set Playlist to CheckPlayRecord()
  453.   if Playlist <> #false then
  454.     if count(Playlist) <> 4 then
  455.       set NOTgood to #true
  456.       DJFeedback(#random)
  457.     else
  458.       set monitorNum to getaProp(getaProp(gObjects, getaProp(getaProp(gObjects, getAt(Playlist, 1)), #Monitor)), #DisplayState)
  459.       repeat with INTRument in Playlist
  460.         set int to getaProp(gObjects, INTRument)
  461.         if (getaProp(int, #State) <> #Chaotic) or (count(getaProp(gNotes, INTRument)) = 0) or (getaProp(getaProp(gObjects, getaProp(int, #Monitor)), #DisplayState) <> monitorNum) then
  462.           set NOTgood to #true
  463.           DJFeedback(#random)
  464.           exit repeat
  465.         end if
  466.       end repeat
  467.       if NOTgood = #false then
  468.         set gCDNotes to [:]
  469.         repeat with INTRument in Playlist
  470.           setaProp(gCDNotes, INTRument, value(string(getaProp(gNotes, INTRument))))
  471.         end repeat
  472.         TheCDGIVE()
  473.         SetDJSTATE()
  474.         genexitkf(#D07)
  475.         exit
  476.       end if
  477.     end if
  478.   else
  479.     set NOTgood to #true
  480.     DJFeedback(#random)
  481.   end if
  482.   set clickRecordtimesNow to getaProp(getaProp(gObjects, #REcordPlayMixer), #clickRecordtimes)
  483.   if voidp(clickRecordtimesNow) then
  484.     PDARelease("J04m13p.mov")
  485.     MakeDynamic(#REcordPlayMixer, #clickRecordtimes, 1)
  486.   end if
  487.   set the castNum of sprite getaProp(getaProp(gObjects, #REcordPlayMixer), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, #REcordPlayMixer), #cast), #UN)
  488.   updateStage()
  489. end
  490.  
  491. on SetDJSTATE
  492.   setaProp(getaProp(gStates, #Conditions), #radioStation, getaProp(getaProp(gStates, #Conditions), #radioStation) + 1)
  493.   MakeDynamic(#DJVid, #newhit, #true)
  494. end
  495.  
  496. on TheCDGIVE
  497.   playSound("D22FXejt.aif", #keyframeCast)
  498.   set CDobj to getaProp(gObjects, #CDobj)
  499.   set Make to getaProp(gObjects, #MakeCDmixer)
  500.   set the loc of sprite getaProp(CDobj, #SpriteNum) to getaProp(Make, #loc)
  501.   repeat with CDcast in getaProp(getaProp(Make, #cast), #FrameData)
  502.     set the castNum of sprite getaProp(CDobj, #SpriteNum) to CDcast
  503.     CursorandUpdate()
  504.   end repeat
  505.   set the loc of sprite getaProp(CDobj, #SpriteNum) to getaProp(CDobj, #loc)
  506.   set the castNum of sprite getaProp(CDobj, #SpriteNum) to getAt(getaProp(getaProp(CDobj, #cast), #UP), 1)
  507.   ReleaseUNVobject(#CDobj)
  508. end
  509.  
  510. on PlaynewSong name
  511.   set the movieRate of sprite sQTCharSprite to 0
  512.   updateStage()
  513.   set PATH to gCDName & "DATA" & gFileSep & "D_enviro" & gFileSep & "D_char" & gFileSep
  514.   set the fileName of cast the castNum of sprite sQTCharSprite to string(PATH & name)
  515.   setSoundVolumes()
  516.   updateStage()
  517.   set the movieTime of sprite sQTCharSprite to 0
  518.   set the movieRate of sprite sQTCharSprite to 1
  519. end
  520.  
  521. on playJukeBox OBJref
  522.   set OBj to getaProp(gObjects, OBJref)
  523.   set songNum to getaProp(OBj, #songNum)
  524.   set qtSongObj to getaProp(gObjects, #JukeBoxQTSong)
  525.   set qtSongSprite to getaProp(qtSongObj, #SpriteNum)
  526.   PlaynewSong(getaProp(getaProp(qtSongObj, #cast), songNum))
  527. end
  528.  
  529. on GetOutOfC
  530.   genexitkf(#d01)
  531. end
  532.  
  533. on EnterD13
  534.   AddObjects([#exitD])
  535. end
  536.  
  537. on stopJukeBoxSong
  538.   set the loop of cast the castNum of sprite sQTCharSprite to 0
  539. end
  540.  
  541. on exitd11
  542.   set the loop of cast the castNum of sprite sQTCharSprite to 0
  543.   set PATH to gCDName & "DATA" & gFileSep & "D_enviro" & gFileSep & "D_char" & gFileSep
  544.   set the fileName of cast the castNum of sprite sQTCharSprite to PATH & "QTDummy.mov"
  545.   openMIDIXObjOut()
  546. end
  547.  
  548. on enterd11
  549.   closeMIDIXObjOut()
  550. end
  551.  
  552. on monitorClick OBJref
  553.   set OBj to getaProp(gObjects, OBJref)
  554.   set IntroObj to getaProp(OBj, #Parent)
  555.   set thestate to getaProp(OBj, #DisplayState) + 1
  556.   if thestate > 4 then
  557.     set thestate to 1
  558.   end if
  559.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), thestate)
  560.   updateStage()
  561.   MakeDynamic(OBJref, #DisplayState, thestate)
  562. end
  563.